import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import basicSsl from '@vitejs/plugin-basic-ssl'

export default defineConfig({
	plugins: [
		uni(),
		basicSsl({
			/** name of certification */
			name: 'test',
			/** custom trust domains */
			domains: ['*.custom.com'],
			/** custom certification directory */
			certDir: '/Users/.../.devServer/cert',
		}),
	],
	server: {
		proxy: {
			'/api': {
				// target: 'http://192.168.0.186:9003',
				// target: "http://192.168.0.98:9003",
				// target: "http://192.168.0.222:9001",
				 target: "http://192.168.0.66:9003",
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/api/, ''),
			},
		},
	},
})
